﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using MySql.Data.MySqlClient;
using System.Data;
public partial class Nhapdulieu : System.Web.UI.Page
{

    
    protected void Page_Load(object sender, EventArgs e)
    {
       
        Label1.Text = Variables.IDDN;


        DatabaseHandler db=new DatabaseHandler();
        db.connect();
        InitializingDatabaseObject ini = new InitializingDatabaseObject(db.loadAllInforByIDDN(Variables.IDDN, "tbl_o"));
        db.close();

        foreach (QuestionObject x in Variables.questionListText)
        {
            if (x != null)
            {
                string id = x.getColumnName().ToString() + "_" + x.getValue().ToString();
                ini.LoadDataToRadioButton(Page.Controls, id);
                ini.LoadDataToTextBox(Page.Controls, x.getColumnName(),x.getValue());
            }
        }







    }
    
   
    
    protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
    {

        Response.Redirect(Redirect.redirectForComboBox(cb1));

    }

    protected void btn_LuuThongTin_Click(object sender, EventArgs e)
    {
        ControlHandler ctHandler = new ControlHandler();
        ctHandler.GetControlList<RadioButton>(Page.Controls, Variables.checkedRadioButtonList);
        ctHandler.GetControlList<TextBox>(Page.Controls, Variables.TextBoxList);
        new AnalysisAndInsert("tbl_o");

        lbShow.Text = "Lưu thông tin doanh nghiệp thành công!";
        

    }
    
    protected void btn_ChiSoTiepTheo_Click1(object sender, EventArgs e)
    {
        Response.Redirect("GiatriHumanResource.aspx");
    }
    protected void O0150A3_TextChanged(object sender, EventArgs e)
    {

    }
    protected void O0150A4_TextChanged(object sender, EventArgs e)
    {

    }
}
